using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class FT_PKT_PSMap : EntityTypeConfiguration<FT_PKT_PS>
    {
        public FT_PKT_PSMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Psid, t.Storenum, t.Regnum, t.Tnumber, t.Number, t.Salesman, t.Date, t.Posted, t.Custcurr, t.Saletype, t.Doctype, t.Location, t.Arreference, t.Cstctrid, t.Printed, t.Invoicemode, t.Applyvat, t.Spid });

            // Properties
            this.Property(t => t.Storenum)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Regnum)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Id)
                .HasMaxLength(6);

            this.Property(t => t.Tnumber)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.Number)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.Salesman)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Time)
                .HasMaxLength(5);

            this.Property(t => t.Ccnum)
                .HasMaxLength(20);

            this.Property(t => t.Ccexp)
                .HasMaxLength(4);

            this.Property(t => t.Checknum)
                .HasMaxLength(10);

            this.Property(t => t.Custcurr)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Ponumber)
                .HasMaxLength(20);

            this.Property(t => t.Authcode)
                .HasMaxLength(7);

            this.Property(t => t.Reference)
                .HasMaxLength(8);

            this.Property(t => t.Saletype)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Doctype)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Cashacct)
                .HasMaxLength(40);

            this.Property(t => t.Howpaid)
                .HasMaxLength(1);

            this.Property(t => t.Sonumber)
                .HasMaxLength(15);

            this.Property(t => t.Location)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.Custname)
                .HasMaxLength(35);

            this.Property(t => t.Arbatch)
                .HasMaxLength(8);

            this.Property(t => t.Glbatch)
                .HasMaxLength(8);

            this.Property(t => t.Arreference)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.Ordernum)
                .HasMaxLength(8);

            this.Property(t => t.Quotenum)
                .HasMaxLength(8);

            this.Property(t => t.Userref)
                .HasMaxLength(15);

            this.Property(t => t.Docnum)
                .HasMaxLength(15);

            this.Property(t => t.Custphone)
                .HasMaxLength(20);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.Custaddr)
                .HasMaxLength(50);

            this.Property(t => t.Lpo)
                .HasMaxLength(30);

            this.Property(t => t.Cstctrid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Delnotenum)
                .HasMaxLength(8);

            this.Property(t => t.Vglbatch)
                .HasMaxLength(10);

            this.Property(t => t.Invoicerem)
                .HasMaxLength(100);

            this.Property(t => t.Reportrem)
                .HasMaxLength(100);

            this.Property(t => t.Project)
                .HasMaxLength(20);

            this.Property(t => t.Invoicemode)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Tsfdestloc)
                .HasMaxLength(10);

            this.Property(t => t.Ps_approval)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.Ps_vend)
                .HasMaxLength(6);

            this.Property(t => t.Ps_desc)
                .HasMaxLength(50);

            this.Property(t => t.Spid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("FT_PKT_PS");
            this.Property(t => t.Psid).HasColumnName("Psid");
            this.Property(t => t.Storenum).HasColumnName("Storenum");
            this.Property(t => t.Regnum).HasColumnName("Regnum");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Pcode).HasColumnName("Pcode");
            this.Property(t => t.Tnumber).HasColumnName("Tnumber");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Salesman).HasColumnName("Salesman");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Time).HasColumnName("Time");
            this.Property(t => t.Subtotal).HasColumnName("Subtotal");
            this.Property(t => t.Cost).HasColumnName("Cost");
            this.Property(t => t.Salestax).HasColumnName("Salestax");
            this.Property(t => t.Gst).HasColumnName("Gst");
            this.Property(t => t.Posted).HasColumnName("Posted");
            this.Property(t => t.Amtpdout).HasColumnName("Amtpdout");
            this.Property(t => t.Ccnum).HasColumnName("Ccnum");
            this.Property(t => t.Ccexp).HasColumnName("Ccexp");
            this.Property(t => t.Checknum).HasColumnName("Checknum");
            this.Property(t => t.Void).HasColumnName("Void");
            this.Property(t => t.Custcurr).HasColumnName("Custcurr");
            this.Property(t => t.Cashrcvd).HasColumnName("Cashrcvd");
            this.Property(t => t.Chkrcvd).HasColumnName("Chkrcvd");
            this.Property(t => t.Ccrcvd).HasColumnName("Ccrcvd");
            this.Property(t => t.Chgrcvd).HasColumnName("Chgrcvd");
            this.Property(t => t.Cashactcur).HasColumnName("Cashactcur");
            this.Property(t => t.Cashpaid).HasColumnName("Cashpaid");
            this.Property(t => t.Chkpaid).HasColumnName("Chkpaid");
            this.Property(t => t.Ccpaid).HasColumnName("Ccpaid");
            this.Property(t => t.Chgpaid).HasColumnName("Chgpaid");
            this.Property(t => t.Ponumber).HasColumnName("Ponumber");
            this.Property(t => t.Authcode).HasColumnName("Authcode");
            this.Property(t => t.Hold).HasColumnName("Hold");
            this.Property(t => t.Reference).HasColumnName("Reference");
            this.Property(t => t.Saletype).HasColumnName("Saletype");
            this.Property(t => t.Doctype).HasColumnName("Doctype");
            this.Property(t => t.Cashacct).HasColumnName("Cashacct");
            this.Property(t => t.Comments).HasColumnName("Comments");
            this.Property(t => t.Amtrecvd).HasColumnName("Amtrecvd");
            this.Property(t => t.Howpaid).HasColumnName("Howpaid");
            this.Property(t => t.Onaccount).HasColumnName("Onaccount");
            this.Property(t => t.Sonumber).HasColumnName("Sonumber");
            this.Property(t => t.Contact).HasColumnName("Contact");
            this.Property(t => t.Location).HasColumnName("Location");
            this.Property(t => t.Custname).HasColumnName("Custname");
            this.Property(t => t.Duedate).HasColumnName("Duedate");
            this.Property(t => t.Closedout).HasColumnName("Closedout");
            this.Property(t => t.Arbatch).HasColumnName("Arbatch");
            this.Property(t => t.Glbatch).HasColumnName("Glbatch");
            this.Property(t => t.Arreference).HasColumnName("Arreference");
            this.Property(t => t.Mode).HasColumnName("Mode");
            this.Property(t => t.Userid).HasColumnName("Userid");
            this.Property(t => t.Orderclosed).HasColumnName("Orderclosed");
            this.Property(t => t.Ordernum).HasColumnName("Ordernum");
            this.Property(t => t.Quotenum).HasColumnName("Quotenum");
            this.Property(t => t.Quotexpiry).HasColumnName("Quotexpiry");
            this.Property(t => t.Shipto).HasColumnName("Shipto");
            this.Property(t => t.Expdelivdate).HasColumnName("Expdelivdate");
            this.Property(t => t.Delivdate).HasColumnName("Delivdate");
            this.Property(t => t.Tradetype).HasColumnName("Tradetype");
            this.Property(t => t.Discval).HasColumnName("Discval");
            this.Property(t => t.Total).HasColumnName("Total");
            this.Property(t => t.Userref).HasColumnName("Userref");
            this.Property(t => t.Docnum).HasColumnName("Docnum");
            this.Property(t => t.Custphone).HasColumnName("Custphone");
            this.Property(t => t.Createuser).HasColumnName("Createuser");
            this.Property(t => t.Edituser).HasColumnName("Edituser");
            this.Property(t => t.Voiduser).HasColumnName("Voiduser");
            this.Property(t => t.B1pdout).HasColumnName("B1pdout");
            this.Property(t => t.B2pdout).HasColumnName("B2pdout");
            this.Property(t => t.Changedue).HasColumnName("Changedue");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.Tax).HasColumnName("Tax");
            this.Property(t => t.Custaddr).HasColumnName("Custaddr");
            this.Property(t => t.Lpo).HasColumnName("Lpo");
            this.Property(t => t.Cstctrid).HasColumnName("Cstctrid");
            this.Property(t => t.Delnotenum).HasColumnName("Delnotenum");
            this.Property(t => t.Doc_ref).HasColumnName("Doc_ref");
            this.Property(t => t.Duration).HasColumnName("Duration");
            this.Property(t => t.Dateordered).HasColumnName("Dateordered");
            this.Property(t => t.Production).HasColumnName("Production");
            this.Property(t => t.Printworksheet).HasColumnName("Printworksheet");
            this.Property(t => t.Siteid).HasColumnName("Siteid");
            this.Property(t => t.Timestmp).HasColumnName("Timestmp");
            this.Property(t => t.Vglbatch).HasColumnName("Vglbatch");
            this.Property(t => t.Ps_vat_rate).HasColumnName("Ps_vat_rate");
            this.Property(t => t.Galileo).HasColumnName("Galileo");
            this.Property(t => t.Invoicerem).HasColumnName("Invoicerem");
            this.Property(t => t.Reportrem).HasColumnName("Reportrem");
            this.Property(t => t.Printed).HasColumnName("Printed");
            this.Property(t => t.Project).HasColumnName("Project");
            this.Property(t => t.Invoicemode).HasColumnName("Invoicemode");
            this.Property(t => t.Applyvat).HasColumnName("Applyvat");
            this.Property(t => t.Tsfdestloc).HasColumnName("Tsfdestloc");
            this.Property(t => t.Ps_pj_project).HasColumnName("Ps_pj_project");
            this.Property(t => t.Ps_repairjob).HasColumnName("Ps_repairjob");
            this.Property(t => t.Ps_approval).HasColumnName("Ps_approval");
            this.Property(t => t.Ps_vend).HasColumnName("Ps_vend");
            this.Property(t => t.Ps_desc).HasColumnName("Ps_desc");
            this.Property(t => t.Spid).HasColumnName("Spid");
        }
    }
}
